Hi all, i have a problem. I want to compare 2 strings with this code
if(matches(str, str2))
{
//Do something
print str "|" str2 "\n"
}
and this is what i get
1. Test|Test why is 2. true? I only want that is 1. and 3. true.... meinhana - Fri Jul 31 07:01:11 EDT 2015 |
Re: String compare? Hi The first parameter of matches is a regular expression string. If this string has the value "Test", then "Test.admin" hits this regexp and so the result is true. Best regards Wolfgang |
Re: String compare?
For equality just use the "==" operator if(str == str2) |
Re: String compare? DoorsXLAustralia - Sun Aug 02 08:25:55 EDT 2015
For equality just use the "==" operator if(str == str2) Thank you! |
Re: String compare?
How can I check the last 4 characters ? Like
string1 = ".txt"
if same => true |
Re: String compare? meinhana - Tue Aug 25 03:40:52 EDT 2015
How can I check the last 4 characters ? Like
string1 = ".txt"
if same => true open DXL manual, search for "string extract", you will see chapter "Substring extraction from string". index notation and length() will help.... print s[ (length s) -4 : ]
|
Re: String compare? Mike.Scharnow - Tue Aug 25 05:26:26 EDT 2015 open DXL manual, search for "string extract", you will see chapter "Substring extraction from string". index notation and length() will help.... print s[ (length s) -4 : ]
Thanks, exactly what i need :) |